import django_filters
from django_filters import filters

class UserActionLogFilter(django_filters.FilterSet):

    devices = django_filters.NumberFilter(
        'devices_id',
        required=False
    )

    user = django_filters.NumberFilter(
        'user_id',
        required=False
    )

    time_start = django_filters.IsoDateTimeFilter(
        "action_time",
        lookup_expr='gt'
    )
    time_end = filters.IsoDateTimeFilter(
        "action_time",
        lookup_expr='lt'
    )
    def filter_time_start(self, queryset, value):
        return queryset
